ALMaSS  1.0
The Animal, Landscape and Man Simulation System
Hare_Female Class Reference

Class for female hares. More...

#include <hare_all.h>

Inheritance diagram for Hare_Female:
Hare_Juvenile THare TAnimal TALMaSSObject

Public Member Functions

virtual void BeginStep (void)
 Female BeginStep. More...
 
virtual void Step (void)
 Female Step. More...
 
virtual void EndStep (void)
 Female EndStep. More...
 
 Hare_Female (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight, int a_age, int a_Ref)
 Female Constructor. More...
 
void ReInit (struct_Hare a_data)
 Female object reinitiation. More...
 
void Init (double p_weight, int a_age, int a_Ref)
 Object initiation. More...
 
virtual ~Hare_Female ()
 Female Destructor. More...
 
void dumpEnergy ()
 Used to record energetic status. More...
 
void SetSterile ()
 Female is sterile. More...
 
virtual void ON_Dead ()
 The female is dead. More...
 
bool UpdateYoung (THare *a_old, THare *a_new)
 Swap a young list pointer. More...
 
void AddYoung (THare *a_new)
 Add a leveret to the list of kids. More...
 
void ON_YoungKilled (THare *a_young)
 A leveret has been killed. More...
 
void ON_RemoveYoung (THare *a_young)
 A leveret has matured. More...
 
void AllYoungKilled ()
 Last leveret predated. More...
 
void AllYoungMatured ()
 No more young to look after. More...
 
bool ON_AreYouMyMum (THare *a_young)
 Debug function. More...
 
bool SanityCheckYoungList ()
 Debug function. More...
 
- Public Member Functions inherited from Hare_Juvenile
 Hare_Juvenile (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight)
 Constructor for the juvenile hare object. More...
 
void ReInit (struct_Hare a_data)
 Juvenile object reinitiation. More...
 
void Init (double p_weight)
 Object initiation. More...
 
virtual ~Hare_Juvenile ()
 Destructor for the juvenile hare object. More...
 
- Public Member Functions inherited from THare
 THare (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
 Constructor. More...
 
void THareInit (int p_x, int p_y, THare_Population_Manager *p_PPM)
 Object Initiation. More...
 
virtual ~THare ()
 Destructor. More...
 
double GetWeight ()
 
double GetTotalWeight ()
 Provide the wet weight of the hare. More...
 
int GetAge ()
 
void ON_MumDead (Hare_Female *a_Mum)
 Inform Mum that we are dead. More...
 
void SetMum (Hare_Female *)
 Set the mother pointer. Reimplemented in Hare_Infant. More...
 
Hare_FemaleGetMum ()
 Get the mother pointer. More...
 
double GetRMR ()
 Get todays RMR. More...
 
int GetRefNum ()
 Get the refnum for this hare. More...
 
void loadVegPalatability (void)
 Loads static member m_vegPalatability with data. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Protected Member Functions

void UpdateOestrous ()
 Update oestrous counter. More...
 
void UpdateGestation ()
 Update gestation counter. More...
 
void GiveBirth ()
 Produce a litter. More...
 
APoint PlaceYoung ()
 Find somewhere nice for the babies to hide. More...
 
void DoLactation ()
 Lactation. More...
 
void Mating ()
 Mate. More...
 
TTypeOfHareState st_Dispersal ()
 Female Dispersal. More...
 
TTypeOfHareState st_Developing ()
 Female Developing. More...
 
TTypeOfHareState st_Foraging ()
 Female Foraging. More...
 
TTypeOfHareState st_Resting ()
 Resting. More...
 
TTypeOfHareState st_ReproBehaviour ()
 Reproductive behaviour control. More...
 
virtual void InternalPesticideHandlingAndResponse ()
 Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
virtual void GeneralEndocrineDisruptor (double a_pesticide_dose)
 Handles internal effects of endocrine distrupter pesticide exposure for female. More...
 
virtual void GeneralOrganoPhosphate (double a_pesticide_dose)
 Handles internal effects of organophosphate pesticide exposure for female. More...
 
- Protected Member Functions inherited from Hare_Juvenile
TTypeOfHareState st_Developing ()
 The development code for Hare_Juvenile. More...
 
TTypeOfHareState st_Foraging ()
 Juvenile foraging. More...
 
void st_NextStage ()
 Maturation to Hare_Male or Hare_Female. More...
 
TTypeOfHareState st_Resting ()
 Juvenile Resting. More...
 
bool ShouldMature ()
 Test for maturation. More...
 
virtual bool WasPredated ()
 Test for mortality. More...
 
- Protected Member Functions inherited from THare
bool Run (int a_dist, int a_direction)
 Run a distance in a direction. More...
 
void EnergyBalance (TTypeOfActivity a_activity, int dist)
 Adjust energy balance for an activity. More...
 
void TimeBudget (TTypeOfActivity a_activity, int dist)
 Adjust time budger for an activity. More...
 
void st_Dying ()
 Tidy up before removing the object on death. More...
 
virtual void Running (int a_max_dist)
 Run. More...
 
void Walking (int a_dist, int a_direction)
 Walking. More...
 
double Forage (int &time)
 Foraging. More...
 
double ForageP (int &time)
 Foraging but also incorporating pesticide exposure. More...
 
double ForageSquare (int a_x, int a_y)
 Forage from an area. More...
 
double ForageSquareP (int a_x, int a_y, double *a_pestexposure)
 Forage from an area and resturn pesticide exposure as well as food. More...
 
int GetPegDistance ()
 Get peg distance. More...
 
int GetPegPull ()
 Get attractive force of peg. More...
 
int GetPegDirection ()
 Get direction of peg. More...
 
void MovePeg ()
 Move the peg according to attraction forces. More...
 
bool OnFarmEvent (FarmToDo event)
 Do we require a response to a farm event. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

int m_NoYoung
 State variable - current litter size. More...
 
int m_litter_no
 State variable - current litter number. More...
 
bool m_sterile
 State variable - is/not sterile. More...
 
int m_OestrousCounter
 State variable - Days in oestrous. More...
 
int m_GestationCounter
 State variable - Days in gestation. More...
 
double m_LeveretMaterial
 State variable - Mass of foetal material. More...
 
TTypeOfActivity m_reproActivity
 State variable - current reproductive state. More...
 
TListOfHares m_MyYoung
 Pointer to litter. More...
 
- Protected Attributes inherited from THare
TTypeOfHareState m_CurrentHState
 Defines the current activity. More...
 
int m_Age
 State variale - hare age. More...
 
Hare_Object m_Type
 State variale - the type of hare. More...
 
double m_weight
 State variale - hare weight g. More...
 
double m_old_weight
 State variale - last hare weight. More...
 
Hare_Femalem_MyMum
 Pointer to the hare's mum. More...
 
THare_Population_Managerm_OurPopulationManager
 Pointer to the hare population manager. More...
 
int m_Lifespan
 Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age) More...
 
int m_ActivityTime
 Minutes of potential activity time per day. More...
 
int m_StarvationDays
 State variable - the number of consecutive days in negative energy balance. More...
 
double m_fatReserve
 State variable - the energy reserve of the hare. More...
 
double m_TodaysEnergy
 State variable - the amount of energy available today, can be in deficit. More...
 
double m_EnergyMax
 State variable - the amount of energy it is possible to eat as a multiplyer or RMR. More...
 
double m_KJRunning
 KJ/m cost of running per kg hare. More...
 
double m_KJWalking
 KJ/m cost of walking per kg hare. More...
 
double m_KJForaging
 KJ/m cost of foraging per kg hare. More...
 
double m_SpeedRunning
 m/min speed of running per kg hare More...
 
double m_SpeedWalking
 m/min speed of walking per kg hare More...
 
double m_foragingenergy
 Energy obtained from foraging/feeding. More...
 
int m_peg_x
 peg x-coordinate More...
 
int m_peg_y
 peg y-coordinate More...
 
int m_RefNum
 Unique hare reference number, also functions as sex flag. More...
 
int m_experiencedDensity
 State variable used in alternative density-dependent configurations. More...
 
int m_lastYearsDensity
 State variable used in alternative density-dependent configurations. More...
 
int m_ddindex
 State variable used in alternative density-dependent configurations. More...
 
int m_expDensity [365]
 State variable used in alternative density-dependent configurations. More...
 
int m_DensitySum
 State variable used in alternative density-dependent configurations. More...
 
bool m_IamSick
 flag for sickness - used in conjunction with disease configurations More...
 
double m_pesticide_burden
 State variable used to hold the current body-burden of pesticide. More...
 
double m_pesticidedegradationrate
 State variable used to hold the daily degredation rate of the pesticide in the body. More...
 
bool m_pesticideInfluenced1
 Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Additional Inherited Members

- Static Public Attributes inherited from THare
static double * m_vegPalatability = NULL
 Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetation can be specified here. More...
 

Detailed Description

Class for female hares.

Constructor & Destructor Documentation

◆ Hare_Female()

Hare_Female::Hare_Female ( int  p_x,
int  p_y,
Landscape p_L,
THare_Population_Manager p_PPM,
double  p_weight,
int  a_age,
int  a_Ref 
)

Female Constructor.

3117  : Hare_Juvenile(p_x, p_y, p_L, p_PPM, p_weight)
3118 {
3119  Init(p_weight,a_age,a_Ref);
3120 }
void Init(double p_weight, int a_age, int a_Ref)
Object initiation.
Definition: Hare_all.cpp:3134
Hare_Juvenile(int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight)
Constructor for the juvenile hare object.
Definition: Hare_all.cpp:2219

References Init().

◆ ~Hare_Female()

Hare_Female::~Hare_Female ( )
virtual

Female Destructor.

3157 {
3158  //Nothing to do
3159 }

Member Function Documentation

◆ AddYoung()

void Hare_Female::AddYoung ( THare a_new)

Add a leveret to the list of kids.

Adds a new young to the mothers list

3845 {
3846  m_MyYoung.push_back(a_new);
3847 }
TListOfHares m_MyYoung
Pointer to litter.
Definition: hare_all.h:1060

References m_MyYoung.

Referenced by THare_Population_Manager::CreateObjects().

◆ AllYoungKilled()

void Hare_Female::AllYoungKilled ( )

Last leveret predated.

Behavioural switch to determine what to do on death of all young. Depends on what we were doing before.

3880 {
3881  switch (m_reproActivity) {
3883  break;
3884  case activity_inoestrous:
3885  break;
3886  case activity_gestation:
3887  break;
3888  case activity_givebirth:
3889  case activity_lactation:
3892  break;
3893  default:
3894  m_OurLandscape->Warn("Hare_Female::AllYoungKilled unknown activity"
3895  ,NULL);
3896  exit(1);
3897  }
3898 }
static CfgInt cfg_DaysToOestrous("HARE_DAYSTOOESTROUS", CFG_CUSTOM, 20)
int value(void)
Definition: configurator.h:98
int m_OestrousCounter
State variable - Days in oestrous.
Definition: hare_all.h:1052
TTypeOfActivity m_reproActivity
State variable - current reproductive state.
Definition: hare_all.h:1058
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
@ activity_gestation
Definition: hare_all.h:98
@ activity_inoestrous
Definition: hare_all.h:97
@ activity_oestrouscycle
Definition: hare_all.h:96
@ activity_lactation
Definition: hare_all.h:100
@ activity_givebirth
Definition: hare_all.h:99

References activity_gestation, activity_givebirth, activity_inoestrous, activity_lactation, activity_oestrouscycle, cfg_DaysToOestrous, m_OestrousCounter, TAnimal::m_OurLandscape, m_reproActivity, CfgInt::value(), and Landscape::Warn().

Referenced by ON_YoungKilled().

◆ AllYoungMatured()

void Hare_Female::AllYoungMatured ( )

No more young to look after.

3932 {
3933  m_NoYoung=0;
3934  switch (m_reproActivity) {
3936  break;
3937  case activity_inoestrous:
3938  break;
3939  case activity_gestation:
3940  break;
3941  case activity_givebirth:
3942  break;
3943  case activity_lactation:
3946  break;
3947  default:
3948  m_OurLandscape->Warn("Hare_Female::AllYoungMatured unknown activity",NULL);
3949  exit(1);
3950  }
3951 }
int m_NoYoung
State variable - current litter size.
Definition: hare_all.h:1045

References activity_gestation, activity_givebirth, activity_inoestrous, activity_lactation, activity_oestrouscycle, cfg_DaysToOestrous, m_NoYoung, m_OestrousCounter, TAnimal::m_OurLandscape, m_reproActivity, CfgInt::value(), and Landscape::Warn().

Referenced by ON_RemoveYoung().

◆ BeginStep()

void Hare_Female::BeginStep ( void  )
virtual

Female BeginStep.

Reimplemented from Hare_Juvenile.

3163 {
3164  m_ActivityTime=1440; // Start the day
3165 #ifdef __SIZERELATEDDEATH
3167  if (m_Age>365) {
3169  ON_Dead();
3170  m_StepDone=true; // We need to skip the step code, we are dead
3171  return;
3172  }
3173  }
3174  }
3175 #endif
3176 #ifdef __DISEASEDDMORTALITY
3177  if (m_IamSick) {
3178  ON_Dead();
3179  m_StepDone=true; // We need to skip the step code, we are dead
3180  return;
3181  }
3182 #endif
3183  if (WasPredated()) {
3184  ON_Dead();
3185  m_StepDone=true; // We need to skip the step code, we are dead
3186  return;
3187  }
3188  // Age physiolocally
3189  if (++m_Age > m_Lifespan) {
3190  ON_Dead();
3191  m_StepDone=true; // We need to skip the step code, we are dead
3192  return;
3193  }
3199  }
3200  // Checking code ***CJT***
3201  m_foragingenergy=0;
3202 #ifdef __DISEASEDDM
3204  if (m_OurLandscape->SupplyDayInYear()==0) {
3208  m_IamSick=true;
3209  }
3210  else m_IamSick=false;
3211  }
3212 #endif
3213 #ifdef __DISEASEDDM2
3215  if (m_OurLandscape->SupplyDayInYear()==0) {
3218  }
3219 #endif
3220 #ifdef __DISEASEDDM3
3221  m_ddindex++;
3222  if (m_ddindex==365) {
3223  m_ddindex=0;
3224  }
3228  m_lastYearsDensity= int(m_DensitySum * (1.0/365.0));
3229 #endif
3230  // Set the maximum possible energy intake
3232  CheckManagement();
3233 }
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
CfgInt cfg_HareFemaleSicknessDensityDepValue("HARE_FEMALESICKNESSDENDEPVALUE", CFG_CUSTOM, 40)
CfgInt cfg_hare_minimum_breeding_weight("HARE_MIN_BREEDING_WT", CFG_CUSTOM, 780)
static CfgFloat cfg_MaxEnergyIntakeScaler("HARE_MAXENERGYINTAKESCALER", CFG_CUSTOM, 3.0)
static CfgFloat cfg_hare_proximity_alert("HARE_PROXIMITY_ALERT", CFG_CUSTOM, 0.05)
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
CfgInt cfg_hare_escape_dist("HARE_ESCAPE_DIST", CFG_CUSTOM, 100)
double value(void)
Definition: configurator.h:118
virtual void ON_Dead()
The female is dead.
Definition: Hare_all.cpp:3956
virtual bool WasPredated()
Test for mortality.
Definition: Hare_all.cpp:2645
int SupplyDayInYear(void)
Definition: landscape.h:1596
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
int m_Location_y
Definition: PopulationManager.h:228
int m_Location_x
Definition: PopulationManager.h:225
void CheckManagement(void)
Definition: PopulationManager.cpp:1404
int GetTotalDensity(int x, int y)
Density function - returns the density of all hares in the square containing by x,...
Definition: hare_all.h:676
double GetKJperM(int a_size)
Get the cost of moving 1m in KJ dependent upon mass (.
Definition: hare_all.h:626
virtual void Running(int a_max_dist)
Run.
Definition: Hare_THare.cpp:152
int m_ddindex
State variable used in alternative density-dependent configurations.
Definition: hare_all.h:281
double m_KJForaging
KJ/m cost of foraging per kg hare.
Definition: hare_all.h:238
int m_experiencedDensity
State variable used in alternative density-dependent configurations.
Definition: hare_all.h:271
double GetRMR()
Get todays RMR.
Definition: Hare_THare.cpp:349
double m_foragingenergy
Energy obtained from foraging/feeding.
Definition: hare_all.h:252
int m_ActivityTime
Minutes of potential activity time per day.
Definition: hare_all.h:203
int m_DensitySum
State variable used in alternative density-dependent configurations.
Definition: hare_all.h:291
double m_EnergyMax
State variable - the amount of energy it is possible to eat as a multiplyer or RMR.
Definition: hare_all.h:223
double m_KJWalking
KJ/m cost of walking per kg hare.
Definition: hare_all.h:233
int m_Age
State variale - hare age.
Definition: hare_all.h:170
int m_lastYearsDensity
State variable used in alternative density-dependent configurations.
Definition: hare_all.h:276
int m_expDensity[365]
State variable used in alternative density-dependent configurations.
Definition: hare_all.h:286
bool m_IamSick
flag for sickness - used in conjunction with disease configurations
Definition: hare_all.h:295
double m_weight
State variale - hare weight g.
Definition: hare_all.h:180
double m_KJRunning
KJ/m cost of running per kg hare.
Definition: hare_all.h:228
THare_Population_Manager * m_OurPopulationManager
Pointer to the hare population manager.
Definition: hare_all.h:194
int m_Lifespan
Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age)
Definition: hare_all.h:198

References cfg_hare_escape_dist, cfg_hare_minimum_breeding_weight, cfg_hare_proximity_alert, cfg_HareFemaleSicknessDensityDepValue, cfg_MaxEnergyIntakeScaler, TAnimal::CheckManagement(), g_rand_uni, THare_Population_Manager::GetKJperM(), THare::GetRMR(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, THare::m_Age, THare::m_ddindex, THare::m_DensitySum, THare::m_EnergyMax, THare::m_expDensity, THare::m_experiencedDensity, THare::m_foragingenergy, THare::m_IamSick, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, THare::m_lastYearsDensity, THare::m_Lifespan, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, ON_Dead(), random(), THare::Running(), Landscape::SupplyDayInYear(), CfgInt::value(), CfgFloat::value(), and Hare_Juvenile::WasPredated().

◆ DoLactation()

void Hare_Female::DoLactation ( )
protected

Lactation.

Feed the young milk.

Here the female uses energy and converts it to milk, which is shared equally between her leverets Assumptions:
a) There is a maximum amount of milk possible to feed to a leveret
b) Equal distribution of inadequate resources

NB the currency is KJ energy not milk per se

3788  {
3797  double sz= (double) m_MyYoung.size();
3798  if (m_fatReserve>0) { // Zero is used here because it is possible to use all fat reserves on this
3799  double en=63.7*m_fatReserve;
3800  // en is the energy available for milk
3801  double rmr=m_MyYoung[0]->GetRMR();
3802  double maxMilk= (rmr+m_OurPopulationManager->GetMaxDailyGrowthEnergy(m_MyYoung[0]->GetAge())) * sz * (1-g_PropSolidFood[m_MyYoung[0]->GetAge()]);
3803  if (en>maxMilk){
3804  en=maxMilk;
3805  }
3806 #ifdef __NOSTARVE
3807  en=maxMilk;
3808 #endif
3809  // remove the energy used
3810  m_fatReserve-=en* (1.0/63.7); // 63.7 is the cost of 1g dw fat
3811  // KJ per young
3812  en/=(double) sz;
3813  vector<THare*>::iterator current = m_MyYoung.begin();
3814  while (current != m_MyYoung.end())
3815  {
3816  dynamic_cast<Hare_Infant*>(*current)->ON_BeingFed(en);
3817  current++;
3818  }
3819  }
3820 }
const double g_PropSolidFood[36]
Definition: Hare_all.cpp:289
Class for infant hares (stationary, only milk inputs)
Definition: hare_all.h:818
void ON_BeingFed(double a_someMilk)
Get energy from milk given.
Definition: Hare_all.cpp:1698
double GetMaxDailyGrowthEnergy(int a_age)
Definition: hare_all.h:552
int GetAge()
Definition: hare_all.h:377
double m_fatReserve
State variable - the energy reserve of the hare.
Definition: hare_all.h:213

References g_PropSolidFood, THare::GetAge(), THare_Population_Manager::GetMaxDailyGrowthEnergy(), THare::m_fatReserve, m_MyYoung, THare::m_OurPopulationManager, and Hare_Infant::ON_BeingFed().

Referenced by GiveBirth(), and st_ReproBehaviour().

◆ dumpEnergy()

void Hare_Female::dumpEnergy ( )

Used to record energetic status.

3472  {
3473  FILE* fp=fopen("EnergyCheck.txt","a");
3474  int wt=int(floor(0.5+m_weight));
3475  int fe=int(floor(0.5+m_foragingenergy));
3476  int fr=int(floor(0.5+m_fatReserve));
3477  int te=int(floor(0.5+m_TodaysEnergy));
3478  fprintf (fp,"%d\t%d\t%d\t%d\t%d\n",(int) m_OurLandscape->SupplyDayInYear(), wt, fe, fr, te);
3479  fclose(fp);
3480 }
double m_TodaysEnergy
State variable - the amount of energy available today, can be in deficit.
Definition: hare_all.h:218

References THare::m_fatReserve, THare::m_foragingenergy, TAnimal::m_OurLandscape, THare::m_TodaysEnergy, THare::m_weight, and Landscape::SupplyDayInYear().

Referenced by st_Foraging().

◆ EndStep()

void Hare_Female::EndStep ( void  )
virtual

Female EndStep.

Reimplemented from Hare_Juvenile.

3291  {
3292  MovePeg();
3294 }
CfgBool cfg_hare_pesticideresponse_on("HARE_PESTICIDERESPONSE_ON", CFG_CUSTOM, false)
If set to true then hares will collect and respond to pesticide information. This will slow the simul...
bool value(void)
Definition: configurator.h:135
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-impl...
Definition: Hare_all.cpp:4008
void MovePeg()
Move the peg according to attraction forces.
Definition: HareForagenPeg.cpp:527

References cfg_hare_pesticideresponse_on, InternalPesticideHandlingAndResponse(), THare::MovePeg(), and CfgBool::value().

◆ GeneralEndocrineDisruptor()

void Hare_Female::GeneralEndocrineDisruptor ( double  a_pesticide_dose)
protectedvirtual

Handles internal effects of endocrine distrupter pesticide exposure for female.

Reimplemented from THare.

4381 {
4382  // May also wish to specify certain gestation days for the effects here
4383  if (m_GestationCounter > 0)
4384  {
4385  m_pesticideInfluenced1 = true;
4386  }
4387 }
int m_GestationCounter
State variable - Days in gestation.
Definition: hare_all.h:1054
bool m_pesticideInfluenced1
Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects u...
Definition: hare_all.h:311

References m_GestationCounter, and THare::m_pesticideInfluenced1.

Referenced by InternalPesticideHandlingAndResponse().

◆ GeneralOrganoPhosphate()

void Hare_Female::GeneralOrganoPhosphate ( double  a_pesticide_dose)
protectedvirtual

Handles internal effects of organophosphate pesticide exposure for female.

Reimplemented from THare.

4394 {
4395  if (g_rand_uni() > l_pest_daily_mort.value()) return;
4397  m_StepDone = true;
4398  return;
4399 }
CfgFloat l_pest_daily_mort
TTypeOfHareState m_CurrentHState
Defines the current activity.
Definition: hare_all.h:165
@ tohs_Dying
Definition: hare_all.h:79

References g_rand_uni, l_pest_daily_mort, THare::m_CurrentHState, TALMaSSObject::m_StepDone, tohs_Dying, and CfgFloat::value().

Referenced by InternalPesticideHandlingAndResponse().

◆ GiveBirth()

void Hare_Female::GiveBirth ( )
protected

Produce a litter.

Give birth to Hare_Infants.

Lets assume we do this a deterministic way. So the number of leverets depends on the mass of leveret material collected.
The size is determined by the mass divided by the number possible such that size stays in the range 95-125g
Litter size limited to max 4

Once they are born they need to be placed somewhere. This should be somewhere where the vegetation is not too sparse

3657 {
3658  double leveret_size;
3659  int NoLeverets=0;
3669  {
3670  // Could do lots now, e.g. take a test to determine if we reduce repro or abandon it.
3671  // The option below reduces the energy for leveret development by 0-100%
3672  //m_LeveretMaterial *= g_rand_uni();
3673  // Here we take it all
3674  m_LeveretMaterial = 0;
3675  m_pesticideInfluenced1 = false;
3676  }
3677 
3678  // THIS CODE IS FOR DOING IT ON THE BASIS OF ENERGY
3679  double mi=cfg_minLeveretBirthWeight.value();
3680  if (m_LeveretMaterial/4.0 > mi) NoLeverets=4;
3681  else if (m_LeveretMaterial/3.0 > mi) NoLeverets=3;
3682  else if (m_LeveretMaterial/2.0 > mi) NoLeverets=2;
3683  else if (m_LeveretMaterial > mi) NoLeverets=1;
3684  if (NoLeverets==0) {
3685  // Can't produce a leveret - abort the pregnancy
3689  return;
3690  }
3691  leveret_size=m_LeveretMaterial/(double)NoLeverets;
3692  if (leveret_size>cfg_maxLeveretBirthWeight.value())
3693  {
3694  leveret_size=cfg_maxLeveretBirthWeight.value();
3695  }
3696  // END ENERGETIC
3697  /*
3698  // THIS IS THE ALTERNATIVE 1 _ GET THE NUMBER BASED ON WHETHER IT IS FIRST, 2ND, 3RD etc..
3699  NoLeverets=m_OurPopulationManager->GetLitterSize(m_litter_no++);
3700  if (NoLeverets<1) {
3701  AllYoungKilled();
3702  return;
3703  }
3704  leveret_size=cfg_HareStartWeight.value(); // NB No variability in start weight
3705  */
3706  // END ALTERNATE 1
3707  /* ALTERNATE 2 - Here we adjust for the weight of the female
3708 
3709  if (m_weight > cfg_hare_minimum_breeding_weight.value() ) {
3710  NoLeverets=m_OurPopulationManager->GetLitterSize(m_litter_no++);
3711  }
3712  else {
3713  }
3714  if (NoLeverets<1) {
3715  AllYoungKilled();
3716  return;
3717  }
3718  leveret_size=cfg_HareStartWeight.value(); // NB No variability in start weight
3719  */
3720 // END ALTERNATE 2
3721 
3722 
3723  // Create the data required
3724  struct_Hare* sp;
3725  sp = new struct_Hare;
3726  sp->HM = m_OurPopulationManager;
3727  sp->L = m_OurLandscape;
3728  sp->Mum=this;
3729  sp->weight=leveret_size;
3731  APoint pt = PlaceYoung();
3732  sp->x = pt.m_x;
3733  sp->y = pt.m_y;
3734  // Make the leverets
3735  m_OurPopulationManager->CreateObjects(0,this,NULL,sp,NoLeverets);
3736  delete sp;
3737  m_litter_no++;
3739 #ifdef __saveLitterInfo
3740  //Temporary Output Start
3741  FILE* fp=fopen("LitterProduction.txt","a");
3742  int month=m_OurLandscape->SupplyMonth();
3743  fprintf(fp,"%i\t%i\t%f\t%d\n",month, NoLeverets, leveret_size, m_litter_no);
3744  fclose(fp);
3745  // End
3746 #endif
3747  // Feed them today
3748  DoLactation();
3749 }
static CfgFloat cfg_minLeveretBirthWeight("HARE_MINLEVERETBIRTHWEIGHT", CFG_CUSTOM, 95 *0.88 *0.33)
static CfgFloat cfg_maxLeveretBirthWeight("HARE_MAXLEVERETBIRTHWEIGHT", CFG_CUSTOM, 125 *0.88 *0.33)
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:53
int m_y
Definition: ALMaSS_Setup.h:56
int m_x
Definition: ALMaSS_Setup.h:55
int m_litter_no
State variable - current litter number.
Definition: hare_all.h:1047
APoint PlaceYoung()
Find somewhere nice for the babies to hide.
Definition: Hare_all.cpp:3755
double m_LeveretMaterial
State variable - Mass of foetal material.
Definition: hare_all.h:1056
void DoLactation()
Lactation.
Definition: Hare_all.cpp:3787
int SupplyMonth(void)
Definition: landscape.h:1601
void CreateObjects(int ob_type, TAnimal *pvo, void *null, struct_Hare *data, int number)
Method used to create new hares.
Definition: Hare_all.cpp:928
Class used to pass hare information to CreateObjects.
Definition: hare_all.h:135
int y
Definition: hare_all.h:138
int x
Definition: hare_all.h:137
Landscape * L
Definition: hare_all.h:140
double weight
Definition: hare_all.h:144
THare_Population_Manager * HM
Definition: hare_all.h:141
Hare_Female * Mum
Definition: hare_all.h:142

References activity_lactation, activity_oestrouscycle, cfg_DaysToOestrous, cfg_maxLeveretBirthWeight, cfg_minLeveretBirthWeight, THare_Population_Manager::CreateObjects(), DoLactation(), struct_Hare::HM, struct_Hare::L, m_LeveretMaterial, m_litter_no, m_OestrousCounter, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_pesticideInfluenced1, m_reproActivity, APoint::m_x, APoint::m_y, struct_Hare::Mum, PlaceYoung(), Landscape::SupplyMonth(), CfgInt::value(), CfgFloat::value(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by st_ReproBehaviour().

◆ Init()

void Hare_Female::Init ( double  p_weight,
int  a_age,
int  a_Ref 
)

Object initiation.

3135 {
3136 
3137  m_Type = hob_Female;
3138  m_fatReserve = p_weight * 3.8*0.04; // To get 4% of WW+ingesta
3139  m_sterile = false;
3140  m_weight = p_weight;
3141  m_old_weight = p_weight;
3142  m_Age = a_age;
3143  m_OestrousCounter = 0;
3144  m_GestationCounter = 0;
3145  m_LeveretMaterial = 0;
3147  m_litter_no = 0;
3148  m_KJWalking = m_OurPopulationManager->GetKJperM((int)floor(0.5 + m_weight));
3149  m_KJRunning = m_KJWalking * 2;
3151  m_IamSick = false;
3152  m_RefNum = a_Ref;
3153 }
bool m_sterile
State variable - is/not sterile.
Definition: hare_all.h:1049
double m_old_weight
State variale - last hare weight.
Definition: hare_all.h:185
Hare_Object m_Type
State variale - the type of hare.
Definition: hare_all.h:175
int m_RefNum
Unique hare reference number, also functions as sex flag.
Definition: hare_all.h:265
@ hob_Female
Definition: hare_all.h:61

References activity_oestrouscycle, THare_Population_Manager::GetKJperM(), hob_Female, THare::m_Age, THare::m_fatReserve, m_GestationCounter, THare::m_IamSick, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, m_LeveretMaterial, m_litter_no, m_OestrousCounter, THare::m_old_weight, THare::m_OurPopulationManager, THare::m_RefNum, m_reproActivity, m_sterile, THare::m_Type, and THare::m_weight.

Referenced by Hare_Female(), and ReInit().

◆ InternalPesticideHandlingAndResponse()

void Hare_Female::InternalPesticideHandlingAndResponse ( )
protectedvirtual

Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes.

This method is re-implemented ffrom THare for any class which has pesticide response behaviour. If the body burden exceeds the trigger then call pesticide-specific actions by dose

Reimplemented from THare.

4009 {
4015  double pesticideInternalConc = m_pesticide_burden / m_weight;
4016 
4018 
4019  if (pesticideInternalConc > cfg_HarePesticideAccumulationThreshold.value())
4020  {
4021  switch (tp)
4022  {
4023  case ttop_NoPesticide:
4024  break;
4026  GeneralEndocrineDisruptor(pesticideInternalConc); // Calls the EndocrineDisruptor action code
4027  break;
4028  case ttop_AcuteEffects:
4029  GeneralOrganoPhosphate(pesticideInternalConc); // Calls the GeneralOrganophosphate action code
4030  break;
4031  default:
4032  exit(47);
4033  }
4034  }
4035  m_pesticide_burden *= m_pesticidedegradationrate; // Does nothing by default except internal degredation of the pesticide
4036 }
CfgFloat cfg_HarePesticideAccumulationThreshold("HARE_PESTICIDEACCUMULATIONTHRESHOLD", CFG_CUSTOM, 0.0)
This is the value that triggers pesticide response, which may be a threshold, or if simply set to 0....
virtual void GeneralOrganoPhosphate(double a_pesticide_dose)
Handles internal effects of organophosphate pesticide exposure for female.
Definition: Hare_all.cpp:4393
virtual void GeneralEndocrineDisruptor(double a_pesticide_dose)
Handles internal effects of endocrine distrupter pesticide exposure for female.
Definition: Hare_all.cpp:4380
int SupplyYearNumber(void)
Definition: landscape.h:1616
TTypesOfPesticide SupplyPesticideType(void)
Definition: landscape.h:433
void BodyBurdenOut(int a_year, int a_day, double a_bb, double a_mgkg)
BodyBurden output.
Definition: hare_all.h:723
double m_pesticide_burden
State variable used to hold the current body-burden of pesticide.
Definition: hare_all.h:301
double m_pesticidedegradationrate
State variable used to hold the daily degredation rate of the pesticide in the body.
Definition: hare_all.h:306
TTypesOfPesticide
Definition: landscape.h:66
@ ttop_NoPesticide
Definition: landscape.h:67
@ ttop_AcuteEffects
Definition: landscape.h:68
@ ttop_ReproductiveEffects
Definition: landscape.h:69

References THare_Population_Manager::BodyBurdenOut(), cfg_HarePesticideAccumulationThreshold, GeneralEndocrineDisruptor(), GeneralOrganoPhosphate(), TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_pesticide_burden, THare::m_pesticidedegradationrate, THare::m_weight, Landscape::SupplyDayInYear(), Landscape::SupplyPesticideType(), Landscape::SupplyYearNumber(), ttop_AcuteEffects, ttop_NoPesticide, ttop_ReproductiveEffects, and CfgFloat::value().

Referenced by EndStep().

◆ Mating()

void Hare_Female::Mating ( )
protected

Mate.

3611 {
3612  // Sigh, need to develop code to determine if a male is close - how does
3613  // she choose a mate?? TODO if we ever consider males limiting or need population genetics
3614  // This is complicated by multiple matings in real life too.
3615  //
3616  // Assuming she has a mate and is mated
3620 }
static CfgInt cfg_hare_DaysToGestation("HARE_GESTATIONDAYS", CFG_CUSTOM, 41)

References activity_gestation, cfg_hare_DaysToGestation, m_GestationCounter, m_LeveretMaterial, m_reproActivity, and CfgInt::value().

Referenced by st_ReproBehaviour().

◆ ON_AreYouMyMum()

bool Hare_Female::ON_AreYouMyMum ( THare a_young)

Debug function.

Debug code for checking young lists.

3975 {
3976  m_NoYoung= (int) m_MyYoung.size();
3977  vector<THare*>::iterator current = m_MyYoung.begin();
3978  while (current != m_MyYoung.end())
3979  {
3980  if (*current == a_young)
3981  {
3982  return true;
3983  }
3984  current++;
3985  }
3986  return false;
3987 }

References m_MyYoung, and m_NoYoung.

◆ ON_Dead()

void Hare_Female::ON_Dead ( void  )
virtual

The female is dead.

Do the housekeeping needed for object destruction

Reimplemented from Hare_Juvenile.

3957 {
3958  // if she has young she must tell them she is dead
3959  vector<THare*>::iterator current = m_MyYoung.begin();
3960  while (current != m_MyYoung.end())
3961  {
3962  (*current)->ON_MumDead(this);
3963  current++;
3964  }
3965  m_MyYoung.clear(); // Needed because of the potential for object re-use
3967  m_CurrentStateNo=-1;
3968  m_StepDone=true;
3969 }
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116

References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, m_MyYoung, TALMaSSObject::m_StepDone, and tohs_Dying.

Referenced by BeginStep(), THare_Population_Manager::Hunting(), THare_Population_Manager::HuntingGrid(), and Step().

◆ ON_RemoveYoung()

void Hare_Female::ON_RemoveYoung ( THare a_young)

A leveret has matured.

This functions simply sorts through the m_Young vector and removes the matured young.
This is identical to ON_YoungKilled, but differs in the result of removing the last one.

3902  {
3908  m_NoYoung= (int) m_MyYoung.size();
3909  vector<THare*>::iterator current = m_MyYoung.begin();
3910  while (current != m_MyYoung.end())
3911  {
3912  if (*current == a_young)
3913  {
3914  m_MyYoung.erase(current);
3915  if (m_MyYoung.size()==0) {
3916  // All young grown up do something appropriate
3917  AllYoungMatured();
3918  }
3919  m_NoYoung= (int) m_MyYoung.size();
3920  return;
3921  }
3922  current++;
3923  }
3924  // Should never get here...raise an error and duck out of the program.
3925  //
3926  m_OurLandscape->Warn("Hare_Female::ON_RemoveYoung - unknown young",NULL);
3927  exit(1);
3928 }
void AllYoungMatured()
No more young to look after.
Definition: Hare_all.cpp:3931

References AllYoungMatured(), m_MyYoung, m_NoYoung, TAnimal::m_OurLandscape, and Landscape::Warn().

Referenced by Hare_Young::st_NextStage().

◆ ON_YoungKilled()

void Hare_Female::ON_YoungKilled ( THare a_young)

A leveret has been killed.

This functions sorts through the m_Young vector and removes the dead young

3851 {
3855  m_NoYoung= (int) m_MyYoung.size();
3856  vector<THare*>::iterator current = m_MyYoung.begin();
3857  while (current != m_MyYoung.end())
3858  {
3859  if (*current == a_young)
3860  {
3861  m_MyYoung.erase(current);
3862  if (m_MyYoung.size()==0) {
3863  // All young eaten do something appropriate
3864  AllYoungKilled();
3865  }
3866  return;
3867  }
3868  current++;
3869  }
3870  // Should never get here...raise an error and duck out of the program.
3871  //
3872  m_OurLandscape->Warn("Hare_Female::ON_YoungKilled - unknown young",NULL);
3873  exit(1);
3874 }
void AllYoungKilled()
Last leveret predated.
Definition: Hare_all.cpp:3879

References AllYoungKilled(), m_MyYoung, m_NoYoung, TAnimal::m_OurLandscape, and Landscape::Warn().

Referenced by THare::st_Dying().

◆ PlaceYoung()

APoint Hare_Female::PlaceYoung ( )
protected

Find somewhere nice for the babies to hide.

Find a place to put the young.

3756 {
3757  APoint pt;
3758  int loop = 0;
3759  while (loop++ < 500)
3760  {
3762  if (m_OurLandscape->SupplyVegHeight(pt.m_x, pt.m_y) >= 30) return pt;
3764  if (m_OurLandscape->SupplyVegHeight(pt.m_x, pt.m_y) >= 30) return pt;
3766  if (m_OurLandscape->SupplyVegHeight(pt.m_x, pt.m_y) >= 30) return pt;
3768  if (m_OurLandscape->SupplyVegHeight(pt.m_x, pt.m_y) >= 30) return pt;
3770  if (m_OurLandscape->SupplyVegHeight(pt.m_x, pt.m_y) >= 30) return pt;
3772  if (m_OurLandscape->SupplyVegHeight(pt.m_x, pt.m_y) >= 30) return pt;
3774  if (m_OurLandscape->SupplyVegHeight(pt.m_x, pt.m_y) >= 30) return pt;
3776  if (m_OurLandscape->SupplyVegHeight(pt.m_x, pt.m_y) >= 30) return pt;
3777  }
3778  pt.m_x = m_Location_x;
3779  pt.m_y = m_Location_y;
3780  return pt;
3781 }
double SupplyVegHeight(int a_polyref)
Definition: landscape.h:936
APoint CorrectCoordsPt(int x, int y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: landscape.h:1544

References Landscape::CorrectCoordsPt(), TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, APoint::m_x, APoint::m_y, and Landscape::SupplyVegHeight().

Referenced by GiveBirth().

◆ ReInit()

void Hare_Female::ReInit ( struct_Hare  a_data)

Female object reinitiation.

3124 {
3125  m_Location_x = a_data.x;
3126  m_Location_y = a_data.y;
3127  m_OurLandscape = a_data.L;
3128  m_CurrentStateNo = 0;
3129  THareInit(a_data.x, a_data.y, a_data.HM);
3130  Init(a_data.weight, a_data.age, a_data.RefNum);
3131 }
void THareInit(int p_x, int p_y, THare_Population_Manager *p_PPM)
Object Initiation.
Definition: Hare_THare.cpp:72
int RefNum
Definition: hare_all.h:143
int age
Definition: hare_all.h:139

References struct_Hare::age, struct_Hare::HM, Init(), struct_Hare::L, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, struct_Hare::RefNum, THare::THareInit(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by THare_Population_Manager::CreateObjects().

◆ SanityCheckYoungList()

bool Hare_Female::SanityCheckYoungList ( )

Debug function.

Debug code for checking young lists.

3993 {
3994  m_NoYoung= (int) m_MyYoung.size();
3995  unsigned int current=0;
3996  while (current < m_MyYoung.size())
3997  {
3998  if (m_MyYoung[current]->GetMum()!=this)
3999  {
4000  return false;
4001  }
4002  current++;
4003  }
4004  return true;
4005 }
Hare_Female * GetMum()
Get the mother pointer.
Definition: hare_all.h:404

References THare::GetMum(), m_MyYoung, and m_NoYoung.

◆ SetSterile()

void Hare_Female::SetSterile ( )
inline

Female is sterile.

1093 { m_sterile = true; }

References m_sterile.

Referenced by THare_Population_Manager::DoFirst().

◆ st_Developing()

TTypeOfHareState Hare_Female::st_Developing ( )
protected

Female Developing.

3298 {
3299  //Assumes that the fatReserve has been added to by st_Foraging from yesterday
3300  //
3301  // This is the last behaviour state called each day, so we can use this to sort out
3302  // the energetics
3303  //Assumes that the fatReserve has been added to by st_Foraging from yesterday
3304  //
3305 
3306  EnergyBalance(activity_Resting, 1440); // calculates the energy use by BMR
3307  if (m_TodaysEnergy<0) {
3308  m_fatReserve+=(m_TodaysEnergy * (1.0/42.7));
3309  m_TodaysEnergy=0;
3310  }
3311  // Grow
3312  // Solid food absorption is already taken into account by this time
3313  if (m_Age<365)
3314  {
3316  if (m_TodaysEnergy<Target) Target=m_TodaysEnergy;
3317  double addedtoday=Target*m_OurPopulationManager->GetGrowthEfficiencyP(m_Age);
3318  m_weight+=addedtoday;
3319  m_TodaysEnergy-=Target;
3321  if (m_TodaysEnergy<Target) Target=m_TodaysEnergy;
3323  m_weight+=addedtoday;
3324  m_TodaysEnergy-=Target;
3325  }
3326  else
3327  {
3329  if (m_TodaysEnergy<Target) Target=m_TodaysEnergy;
3331  double addedtoday=Target*gf;
3332  m_weight+=addedtoday;
3333  m_TodaysEnergy-=Target;
3334  }
3335  if (m_TodaysEnergy>0)
3336  {
3337  // Put what remains back into fat reserve
3338  m_fatReserve+=m_TodaysEnergy*m_OurPopulationManager->GetGrowthEfficiencyF(366); // 366 is the adult fat conversion efficiency
3339  m_TodaysEnergy=0;
3340  // Cap the fat reserve and store surplus energy for today
3343  }
3344  m_StarvationDays=0; // Not starving
3345  return tohs_Foraging;
3346  }
3347  else {
3348  m_fatReserve+=m_TodaysEnergy*m_OurPopulationManager->GetGrowthEfficiencyF(366); // 366 is the adult fat conversion efficiency
3349  if (m_fatReserve<0)
3350  {
3352  m_fatReserve=0.0;
3353  }
3354  else m_TodaysEnergy=0;
3355  // What should the criteria for a starvation day be?
3356  //double rmr=m_OurPopulationManager->GetRMR(m_Age, GetTotalWeight());
3357  //if (m_TodaysEnergy<(0.0-(rmr*0.25)))
3358  if (m_TodaysEnergy<0.0)
3359  {
3360  // Oh oh, we are starving need to lose body weight and maybe we will die?
3361 #ifdef __ADULT_WT_STARVE_CHANCE
3362  int testval=0;
3364  // Somewhere between juvenile and adult so use in between values
3365  int diff = cfg_adult_starve.value() - cfg_juv_starve.value();
3366  testval=cfg_adult_starve.value()- (int)((1.0-((double)m_Age/cfg_fixadult_starve.value()))*diff);
3367 
3368  } else testval=cfg_adult_starve.value();
3370  if (random(10000)> testval) {
3371  return tohs_Dying;
3372  }
3373  }
3374  #ifdef __NOKNOCKONENERGYEFFECT
3375  else m_TodaysEnergy=0.0;
3376  #endif
3377 #else
3379  return tohs_Dying;
3380  }
3381 #endif
3382  }
3383  else {
3384  m_StarvationDays--; // Not starving
3386  m_TodaysEnergy=0;
3387  }
3388  // If we have kids then we expect this for a while, so only dispere if fat reserves are less than 0
3390  if (random(3)==0) return tohs_Dispersal; // We are hungry, we need to disperse
3391  }
3392  } // end if energy<0
3393  return tohs_Foraging;
3394 }
static CfgFloat cfg_AdultMaxFat("HARE_ADULT_MAXFAT", CFG_CUSTOM, 0.04/(0.33 *0.88))
CfgInt cfg_adult_starve("HARE_ADULT_STARVE", CFG_CUSTOM, 5000)
CfgInt cfg_fixadult_starve("HARE_FIXADULT_STARVE", CFG_CUSTOM, 360)
static CfgInt cfg_adult_starvation_threshold("HARE_ADULT_STARVE_THRESHOLD", CFG_CUSTOM, 16)
CfgInt cfg_juv_starve("HARE_JUV_STARVE", CFG_CUSTOM, 2500)
double GetGrowthEfficiencyP(int a_age)
Get the growth efficiency for this a_age for creating protein.
Definition: hare_all.h:602
double GetMaxDailyGrowthEnergyF(int a_age)
Get the maximum daily energy needed for growth for this a_age for use in fat construction.
Definition: hare_all.h:578
double GetMaxDailyGrowthEnergyP(int a_age)
Get the maximum daily energy needed for growth for this a_age for use in protein construction.
Definition: hare_all.h:565
double GetGrowthEfficiencyF(int a_age)
Get the growth efficiency for this a_age for creating fat.
Definition: hare_all.h:614
void EnergyBalance(TTypeOfActivity a_activity, int dist)
Adjust energy balance for an activity.
Definition: Hare_THare.cpp:277
int m_StarvationDays
State variable - the number of consecutive days in negative energy balance.
Definition: hare_all.h:208
@ activity_Resting
Definition: hare_all.h:90
@ tohs_Foraging
Definition: hare_all.h:75
@ tohs_Dispersal
Definition: hare_all.h:74

References activity_lactation, activity_Resting, cfg_adult_starvation_threshold, cfg_adult_starve, cfg_AdultMaxFat, cfg_fixadult_starve, cfg_juv_starve, THare::EnergyBalance(), THare_Population_Manager::GetGrowthEfficiencyF(), THare_Population_Manager::GetGrowthEfficiencyP(), THare_Population_Manager::GetMaxDailyGrowthEnergyF(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare::m_Age, THare::m_fatReserve, THare::m_OurPopulationManager, m_reproActivity, THare::m_StarvationDays, THare::m_TodaysEnergy, THare::m_weight, random(), tohs_Dispersal, tohs_Dying, tohs_Foraging, CfgInt::value(), and CfgFloat::value().

Referenced by Step().

◆ st_Dispersal()

TTypeOfHareState Hare_Female::st_Dispersal ( )
protectedvirtual

Female Dispersal.

Uses the base class st_dispersal but then adds some special female functionality.

Reimplemented from Hare_Juvenile.

3486 {
3488  if (tohs==tohs_Dying) return tohs_Dying;
3489  // If dispersal is called, then she must be deserting any young she has
3490  // The easiest way to do this is to lie, and tell them she is dead
3491  vector<THare*>::iterator current = m_MyYoung.begin();
3492  while (current != m_MyYoung.end()) {
3493  (*current)->ON_MumDead(this);
3494  current++;
3495  }
3496  // Now must clear the list.
3497  if (m_MyYoung.size()>=1) {
3498  m_MyYoung.erase(m_MyYoung.begin(),m_MyYoung.end()); // Remove all elements
3500  }
3503  return tohs_Foraging;
3504 }
TTypeOfHareState st_Dispersal()
Juvenile Dispersal.
Definition: Hare_all.cpp:2449
int m_peg_x
peg x-coordinate
Definition: hare_all.h:256
int m_peg_y
peg y-coordinate
Definition: hare_all.h:260
TTypeOfHareState
Enumerator for hare behavioural states.
Definition: hare_all.h:70

References activity_oestrouscycle, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MyYoung, THare::m_peg_x, THare::m_peg_y, m_reproActivity, Hare_Juvenile::st_Dispersal(), tohs_Dying, and tohs_Foraging.

Referenced by Step().

◆ st_Foraging()

TTypeOfHareState Hare_Female::st_Foraging ( )
protected

Female Foraging.

Effectively the day is started here, unless we have been dispersing.
At this point we have a whole day to use and need to figure out how to use it.
There are some constraints on the time we can use for foraging such that we need a certain amount of time for resting e.g. coprophagy. For now I am going to assume that the resting time required is proportional to forage time used and the ratio of the two is in cfg_ForageRestingRatio

Four different ways of implementing density dependence are selectable here.

3398 {
3411  double time= (double) m_ActivityTime * cfg_ForageRestingRatio.value();
3412  // We need to rest if there is no more time
3413  if (time < 30 ) return tohs_Resting;
3414  // If there are more hares here then interference reduces the activity time
3415 #ifdef __DELAYEDDD
3417 #else
3419 #endif
3420 #ifdef __THRESHOLD_AD_DD
3421  if (hares<m_OurPopulationManager->m_HareThresholdDD) hares=0;
3423 #endif
3424 #ifdef __DISEASEDDM2
3426 #else
3427 #ifdef __DISEASEDDM3
3429 #else
3430 #ifndef __DDEPMORT
3431  double inter=m_OurPopulationManager->GetInterference(hares);
3432 #else
3433  #ifndef __DISEASEDDM
3434  double inter=m_OurPopulationManager->GetInterference(hares);
3435  #else
3436  double inter=1.0;
3437  #endif
3438 #endif
3439 #endif
3440 #endif
3441  if ((inter<0.5) && (time > 300))
3442  {
3443  if (m_reproActivity!=activity_lactation) { // Don't abandon kids just because others want to be here too
3444  if (g_rand_uni() > inter) // added to reduce rate of dispersal
3445  {
3446  //m_ActivityTime = (int)(time / cfg_ForageRestingRatio.value());
3447  return tohs_Dispersal; // Added Sat 15th Dec 2007
3448  }
3449  }
3450  }
3451  time*=inter;
3452  // Given the time we have then we need to feed, which will return an energy value obtained.
3453  int a_time = (int) time;
3455  {
3456  m_TodaysEnergy = ForageP(a_time);
3457  }
3458  else
3459  {
3460  m_TodaysEnergy = Forage(a_time);
3461  }
3462  // We need to spend energy on foraging and associated movement - done in ForageSquare()
3463  //
3464  TimeBudget(activity_Foraging, (int)time-a_time);
3465  // Print the energy checking output
3466 #ifdef __saveEnergyInfo
3467  dumpEnergy();
3468 #endif
3469  return tohs_ReproBehaviour;
3470 }
CfgFloat cfg_ForageRestingRatio("HARE_FORAGERESTRATIO", CFG_CUSTOM, 0.67)
void dumpEnergy()
Used to record energetic status.
Definition: Hare_all.cpp:3472
int m_HareThresholdDD
Input variable - Threshold density dependence level.
Definition: hare_all.h:750
int GetDelayedAdultDensity(int x, int y)
Density function - returns the density of adults in the square containing by x,y, but for last year a...
Definition: hare_all.h:689
double GetInterference(int h)
Return the proportion of time used in communicating with con-specifics.
Definition: hare_all.h:700
int GetAdultDensity(int x, int y)
Density function - returns the density of adults in the square containing by x,y. Each square is 256x...
Definition: hare_all.h:681
double Forage(int &time)
Foraging.
Definition: HareForagenPeg.cpp:54
void TimeBudget(TTypeOfActivity a_activity, int dist)
Adjust time budger for an activity.
Definition: Hare_THare.cpp:314
double ForageP(int &time)
Foraging but also incorporating pesticide exposure.
Definition: HareForagenPeg.cpp:181
@ activity_Foraging
Definition: hare_all.h:92
@ tohs_Resting
Definition: hare_all.h:76
@ tohs_ReproBehaviour
Definition: hare_all.h:77

References activity_Foraging, activity_lactation, cfg_ForageRestingRatio, cfg_hare_pesticideresponse_on, dumpEnergy(), THare::Forage(), THare::ForageP(), g_rand_uni, THare_Population_Manager::GetAdultDensity(), THare_Population_Manager::GetDelayedAdultDensity(), THare_Population_Manager::GetInterference(), THare::m_ActivityTime, THare_Population_Manager::m_HareThresholdDD, THare::m_lastYearsDensity, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_OurPopulationManager, m_reproActivity, THare::m_TodaysEnergy, THare::TimeBudget(), tohs_Dispersal, tohs_ReproBehaviour, tohs_Resting, CfgFloat::value(), and CfgBool::value().

Referenced by Step().

◆ st_ReproBehaviour()

TTypeOfHareState Hare_Female::st_ReproBehaviour ( )
protected

Reproductive behaviour control.

A switch determining what repro behaviour to carry out.

Repro behaviour to consider:
1) Mating - either a function of her or the male - but lets keep it here so the male is a simple as possible.
2) Update Gestation.
3) Give Birth.
4) Lactation.
5) Getting resources for leveret production.
6) Determining leveret size and litter size?

Also optional mortality based upon reproductive mortality

3521 {
3535  // First find out what kind of behaviour we are in:
3536 #ifdef __REPROMORTCHANCE
3537  // Repromortchance is a function of size, the bigger you are the less chance of mortality
3538  int mc=0;
3539 #endif
3540  switch(m_reproActivity)
3541  {
3543  UpdateOestrous();
3544  break;
3545  case activity_inoestrous:
3546  Mating();
3547  break;
3548  case activity_gestation:
3549  UpdateGestation();
3550  break;
3551  case activity_givebirth:
3552 #ifdef __REPROMORTCHANCE
3553  // Repromortchance is a function of size, the bigger you are the less chance of mortality
3556  return tohs_Dying;
3557  }
3558 #endif
3559  GiveBirth();
3560  break;
3561  case activity_lactation:
3562  DoLactation();
3563  break;
3564  default:
3565  m_OurLandscape->Warn("Hare_Female::st_ReproBehaviour unknown activity"
3566  ,NULL);
3567  exit(1);
3568  }
3569  return tohs_Resting;
3570 }
CfgInt cfg_HareFemaleReproMortValue("HARE_FEMALEREPROMORT", CFG_CUSTOM, 0)
void GiveBirth()
Produce a litter.
Definition: Hare_all.cpp:3656
void UpdateOestrous()
Update oestrous counter.
Definition: Hare_all.cpp:3580
void Mating()
Mate.
Definition: Hare_all.cpp:3610
void UpdateGestation()
Update gestation counter.
Definition: Hare_all.cpp:3626

References activity_gestation, activity_givebirth, activity_inoestrous, activity_lactation, activity_oestrouscycle, cfg_hare_minimum_breeding_weight, cfg_HareFemaleReproMortValue, DoLactation(), GiveBirth(), TAnimal::m_OurLandscape, m_reproActivity, THare::m_weight, Mating(), random(), tohs_Dying, tohs_Resting, UpdateGestation(), UpdateOestrous(), CfgInt::value(), and Landscape::Warn().

Referenced by Step().

◆ st_Resting()

TTypeOfHareState Hare_Female::st_Resting ( )
protected

Resting.

This method uses up the rest of the day in resting

3508 {
3512  return tohs_Developing;
3513 }
@ tohs_Developing
Definition: hare_all.h:73

References tohs_Developing.

Referenced by Step().

◆ Step()

void Hare_Female::Step ( void  )
virtual

Female Step.

Reimplemented from Hare_Juvenile.

3237 {
3238  if (m_StepDone || m_CurrentStateNo == -1) return;
3239  switch (m_CurrentHState)
3240  {
3241  case tohs_InitialState: // Initial state
3243  break;
3244  case tohs_Dispersal:
3245  // Legal returns are:
3246  // tohs_Foraging
3247  // Dispersal is risky therefore take a test again
3248 #ifdef __DISPERSALDDM
3250  ON_Dead();
3251  m_StepDone=true; // We need to skip the step code, we are dead
3252  return;
3253  }
3254 #endif
3256  break;
3257  case tohs_Foraging:
3258  // Legal returns are:
3259  // tohs_ReproBehaviour
3261  break;
3262  case tohs_Resting:
3263  // Legal returns are:
3264  // tohs_Developing
3266  break;
3267  case tohs_ReproBehaviour:
3268  // Legal returns are:
3269  // tohs_Resting (& possibly dying)
3271  break;
3272  case tohs_Developing:
3273  // Legal returns are:
3274  // tohs_Dying
3275  // tohs_Foraging
3276  // tohs_Dispersal
3278  m_StepDone=true;
3279  break;
3280  case tohs_Dying:
3281  ON_Dead();
3282  m_StepDone=true;
3283  break;
3284  default:
3285  m_OurLandscape->Warn("Hare_Female::Step - unknown state",NULL);
3286  exit(1);
3287  }
3288 }
CfgFloat cfg_hare_adult_predation("HARE_ADULT_PREDATION", CFG_CUSTOM, 0.0023)
TTypeOfHareState st_Resting()
Resting.
Definition: Hare_all.cpp:3507
TTypeOfHareState st_ReproBehaviour()
Reproductive behaviour control.
Definition: Hare_all.cpp:3520
TTypeOfHareState st_Dispersal()
Female Dispersal.
Definition: Hare_all.cpp:3485
TTypeOfHareState st_Foraging()
Female Foraging.
Definition: Hare_all.cpp:3397
TTypeOfHareState st_Developing()
Female Developing.
Definition: Hare_all.cpp:3297
@ tohs_InitialState
Definition: hare_all.h:71

References cfg_hare_adult_predation, g_rand_uni, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, ON_Dead(), st_Developing(), st_Dispersal(), st_Foraging(), st_ReproBehaviour(), st_Resting(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_ReproBehaviour, tohs_Resting, CfgFloat::value(), and Landscape::Warn().

◆ UpdateGestation()

void Hare_Female::UpdateGestation ( )
protected

Update gestation counter.

Counts down gestation and grows foetal mass.

Figures out how much energy to use on growing the kids and add this to the m_LeveretMaterial
Some assumptions:
1) Foetal growth is linear, with a max per day
2) If the female's fat reserves fall below the hunger threshold value
she does not use energy on the foetus
3) maximum X% of the free energy is used on foetus production - this is an input variable.

3627 {
3628  // Now are they ready to be born?
3629  if (--m_GestationCounter<1) {
3631  }
3641  // ALL the calcuations below are in g fat, this is just to save on unnecessary conversions
3642  // and divides later
3646  if (en>fe) en=fe;
3647  m_fatReserve-=en;
3648  m_LeveretMaterial+=en;
3649  }
3650 }
const double g_hare_maxFoetalKJ[41]
Definition: Hare_all.cpp:350
CfgFloat cfg_hare_foetusenergyproportion("HARE_FOETUSENERGYPROPORTION", CFG_CUSTOM, 0.024)
static CfgFloat cfg_hare_adult_dispersal_threshold("HARE_ADULT_DISP_THESHOLD", CFG_CUSTOM, 1600 *0.02)

References activity_givebirth, cfg_hare_adult_dispersal_threshold, cfg_hare_foetusenergyproportion, g_hare_maxFoetalKJ, THare::m_fatReserve, m_GestationCounter, m_LeveretMaterial, m_reproActivity, and CfgFloat::value().

Referenced by st_ReproBehaviour().

◆ UpdateOestrous()

void Hare_Female::UpdateOestrous ( )
protected

Update oestrous counter.

Updates Oestrous if it is the breeding season.

Optional disease and minimum reproductive weight code for POM.

3581 {
3582 #ifdef __DISEASEDDM
3583  if (m_IamSick) {
3584  return; // will loop each day until not sick
3585  }
3586 #endif
3587 #ifdef __MINREPWEIGHT
3588  if (m_weight<cfg_hare_minimum_breeding_weight.value()) return; // No breeding below this weight
3589 #endif
3590 
3591  // No breeding outside the breeding season
3592  int today=m_OurLandscape->SupplyDayInYear();
3593  if ((today<cfg_ReproStartDay.value()) || (today>cfg_ReproEndDay.value()) )
3594  {
3596  m_litter_no=0;
3597  return;
3598  }
3600  // No breeding if in -ve energy balance
3604  }
3605  }
3606 }
static CfgFloat cfg_hare_adult_breed_threshold("HARE_ADULT_BREED_THESHOLD", CFG_CUSTOM, 1600 *0.03)
static CfgInt cfg_ReproStartDay("HARE_REPROSTARTDAY", CFG_CUSTOM, 18)
static CfgInt cfg_ReproEndDay("HARE_REPROENDDAY", CFG_CUSTOM, 240)

References activity_inoestrous, cfg_DaysToOestrous, cfg_hare_adult_breed_threshold, cfg_hare_minimum_breeding_weight, cfg_ReproEndDay, cfg_ReproStartDay, THare::m_fatReserve, THare::m_IamSick, m_litter_no, m_OestrousCounter, TAnimal::m_OurLandscape, m_reproActivity, THare::m_weight, Landscape::SupplyDayInYear(), CfgInt::value(), and CfgFloat::value().

Referenced by st_ReproBehaviour().

◆ UpdateYoung()

bool Hare_Female::UpdateYoung ( THare a_old,
THare a_new 
)

Swap a young list pointer.

This functions simply sorts through the m_Young vector and replaces the occurence of a_old with a_new. It is used to replace Hare_Infant pointers with Hare_Young pointers

3824 {
3828 vector<THare*>::iterator current = m_MyYoung.begin();
3829 while (current != m_MyYoung.end())
3830 {
3831  if (*current == a_old)
3832  {
3833  *current=a_new;
3834  return true;
3835  }
3836  current++;
3837 }
3838 return false;
3839 }

References m_MyYoung.

Referenced by THare_Population_Manager::CreateObjects().

Member Data Documentation

◆ m_GestationCounter

int Hare_Female::m_GestationCounter
protected

State variable - Days in gestation.

Referenced by GeneralEndocrineDisruptor(), Init(), Mating(), and UpdateGestation().

◆ m_LeveretMaterial

double Hare_Female::m_LeveretMaterial
protected

State variable - Mass of foetal material.

Referenced by GiveBirth(), Init(), Mating(), and UpdateGestation().

◆ m_litter_no

int Hare_Female::m_litter_no
protected

State variable - current litter number.

Referenced by GiveBirth(), Init(), and UpdateOestrous().

◆ m_MyYoung

◆ m_NoYoung

int Hare_Female::m_NoYoung
protected

State variable - current litter size.

Referenced by AllYoungMatured(), ON_AreYouMyMum(), ON_RemoveYoung(), ON_YoungKilled(), and SanityCheckYoungList().

◆ m_OestrousCounter

int Hare_Female::m_OestrousCounter
protected

State variable - Days in oestrous.

Referenced by AllYoungKilled(), AllYoungMatured(), GiveBirth(), Init(), and UpdateOestrous().

◆ m_reproActivity

TTypeOfActivity Hare_Female::m_reproActivity
protected

◆ m_sterile

bool Hare_Female::m_sterile
protected

State variable - is/not sterile.

Referenced by Init(), and SetSterile().


The documentation for this class was generated from the following files: